/**
 * Created by chengming on 18/4/16.
 * version 1.0
 */
const log4js = require('log4js');

log4js.configure({
	appenders:{
		out:{
			type:'stdout',
			layout:{
				type:'pattern',
				pattern: '[%d{yyyy-MM-dd hh.mm.ss.SSS}] [%p] %c %m',
			}
		},
		file:{
			type:'file',
			filename:'logs/downloader.log',
			maxLogSize:30720000,
			backups:30,
			layout:{
				type:'pattern',
				pattern: '[%d{yyyy-MM-dd hh.mm.ss}] [%p] %c %m',
			}
		}
	},
	categories:{
		default:{
			appenders:['out', 'file'],
			level:"trace"
		}
	}
});

const logger = log4js.getLogger();
logger.level = 'TRACE';

module.exports = logger;